package com.example.wm.controller;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.example.wm.common.Result;
import com.example.wm.common.ResultData;
import com.example.wm.entity.Prejudgment;

import com.example.wm.mapper.PrejudgmentMapper;
import com.example.wm.service.PrejudgmentService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@Slf4j
@RestController
@RequestMapping("/Prejudegement")
@CrossOrigin
public class PrejudgmentController {
    @Resource
    private PrejudgmentService prejudgmentService;
    @Resource
    private PrejudgmentMapper prejudgmentMapper;

    //查找判定人
    @Transactional
    @PostMapping("/findbyid")
    public Result findmessage(@RequestBody JSONObject jsonObject) {
           LambdaQueryWrapper<Prejudgment> lq=new LambdaQueryWrapper<>();
           lq.eq(Prejudgment::getGbid,jsonObject.getString("id"));
           List<Prejudgment> list=prejudgmentMapper.selectList(lq);
        return ResultData.success("操作成功",list);
    }


}
